function localMethod(){

}
localMethod.prototype = {
	set: function(key, value) {
        window.localStorage[key] = value;
    },
    get: function(key, defaultValue) {
        return window.localStorage[key] || defaultValue;
    }, 
    setSessionObj: function(key, value){
        window.sessionStorage[key] = JSON.stringify(value);
    },
    getSessionObj: function(key){
         return JSON.parse(window.sessionStorage[key] || '{}');
    },
    //存储对象，以JSON格式存储
    setObject: function(key, value) {
        window.localStorage[key] = JSON.stringify(value);
    }, //读取对象
    getObject: function(key) {
        return JSON.parse(window.localStorage[key] || '{}');
    },
    remove: function(key) {
        window.localStorage[key] = '';
    },
    removeObject: function(key) {
        localStorage.removeItem(key);
    },
    removeSessObject: function(key) {
        sessionStorage.removeItem(key);
    }
}
//module.exports = localMethod; 